﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

using SMSSnew.DATA.CLASSES;

namespace SMSSnew.UI.vicePrincipal.timetable
{
    public partial class vicePrinTtTeacherView : System.Web.UI.Page
    {
        timeTableCLZ viewTT;

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                timeTableCLZ objTimetableClass = new timeTableCLZ();
                DataTable dt1;
                dt1 = objTimetableClass.loadTeacherIdCbo();

                if (dt1.Rows.Count != 0)
                {
                    for (int i = 0; i < dt1.Rows.Count; i++)
                    {
                        cboTeacherId.Items.Insert(i, dt1.Rows[i][0].ToString());
                    }
                }


            }


        }

        protected void Button1_Click(object sender, EventArgs e)
        {


            try
            {
                DataTable viewTeacherTimetable = new DataTable();
                viewTT = new timeTableCLZ();

                viewTeacherTimetable = viewTT.viewTeacherTimetable(cboTeacherId.SelectedValue);
                ttTeacherViewGrid.DataSource = viewTeacherTimetable;
                ttTeacherViewGrid.DataBind();

                viewTT.loadTimetableToGrid();




                //DataTable leaveGrid = new DataTable();
                //sendDataToDB = new LeaveApplicationListDA();

                //leaveGrid = sendDataToDB.loadLeavesToVPrincipal();
                //grdRequestedLeaves.DataSource = leaveGrid;
                //grdRequestedLeaves.DataBind();
            }
            catch (Exception ex)
            {
                throw ex;
            }

        }



    }
}
